package com.guangyunl.a_array;
// 获取数组元素
public class Demo06Array {
    public static void main(String[] args) {
        // 定义一个长度为3的int型数组arr1
        int[] arr1 = new int[3];
        // 输出数组arr1的地址值
        System.out.println("arr1的地址值为: " + arr1); // arr1的地址值为: [I@6d311334
        System.out.println("arr1[0] = " + arr1[0]); // arr1[0] = 0 int型数组的默认值为0
        System.out.println("arr1[1] = " + arr1[1]); // arr1[1] = 0
        System.out.println("arr1[2] = " + arr1[2]); // arr1[2] = 0
    }
}

/*
arr1的地址值为: [I@6d311334
arr1[0] = 0
arr1[1] = 0
arr1[2] = 0
 */